export {};

interface Post {
    url: string,
    type: string,
    // 可无的成员
    title?: string,
    // 只读成员
    readonly subTitle?: string,
    [prop: string]: string
}

function printPost(post: Post) {
    console.log(post.type);
    console.log(post.url);
}

printPost({
    type: 'asd',
    url: 'aaa'
});

const post1: Post = {
    url: 'string',
    type: 'string'
}
// 只读成员不可修改
// post1.subTitle = 'asd';

// 自定义成员
const post2: Post = {
    url: 'string',
    type: 'string'
};

post2.asd = 'asd';